let myapi = {
    login(formData, layer) {
        $.ajax({
            url: localStorage.getItem('ctx') + "/security/token",
            type: "post",
            data: formData,
            processData: false,
            contentType: false,
            success: res => {
                layer.msg("登录成功")
                sessionStorage.setItem('username', formData.get('username'))
                sessionStorage.setItem('access_token', res.access_token)
                location.href = ctx + "/main.html"
            },
            error: e => console.log(e)
        })
    }
}
